package com.example.demo.listener;

import com.example.demo.event.UserMailEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Description :
 * @Author : Bruce Lee
 * @CreateTime : 2024/3/27
 */


@Component
public class UserEmailListener implements ApplicationListener<UserMailEvent> {
    @Override
    public void onApplicationEvent(UserMailEvent event) {
        System.out.println("监听到事件(ApplicationListener接口)：" + event.getEmail().getSender());
    }
}
